package com.meiricai.sdk.core;

import java.lang.reflect.Type;
import java.util.Date;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.meirimoney.sdk.models.AccessToken;

public class JsonUtils {
	public static <T> T fromJson(String json, Type typeOfT) {
		GsonBuilder gsonb = new GsonBuilder();
		gsonb.registerTypeAdapter(Date.class, new DateDeserializer());
		Gson gson = gsonb.create();
		return gson.fromJson(json, typeOfT);
	}
}
